fix(ci): restore central review, security, snapshots, and hourly repair - #731
fix(ci): restore central review, security, snapshots, and hourly repair#731seonghobae wants to merge 38 commits into
Conversation
|
@opencode-agent Please review exact head |
|
@cwl-noema-review Please independently review exact head |
|
Warning Review limit reached
Next review available in: 37 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Pull request was converted to draft
|
@coderabbitai review Please review the current head. All exact-head security, CodeQL, Semgrep, OSV, SBOM, Secret Scan, Scorecard, and Python Security workflows are green; this PR is intended to repair the protected baseline before dependent coverage and stale-pin PRs continue. |
|
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
@opencode-agent Please review refreshed exact head |
|
@cwl-noema-review Please independently review refreshed exact head |
|
@coderabbitai review Please start a full current-head review now that the prior quota window has elapsed. Review exact head |
|
✅ Action performedFull review finished. Your included review limit is currently reached under our Fair Usage Limits Policy. This review may still proceed through usage-based billing if eligible. Your next included review will be available in 38 minutes. |
|
@copilot review the exact current head |
|
@opencode-agent @cwl-noema-review Current exact head is now |
|
@opencode-agent Please review exact current head |
|
@cwl-noema-review Please independently review exact current head |
|
@opencode-agent @cwl-noema-review Exact head |
|
@opencode-agent Exact current head is |
|
@cwl-noema-review Exact current head is |
There was a problem hiding this comment.
Pull request overview
OpenCode reviewed the current-head bounded evidence and requested changes before merge.
Findings
1. P1 .github/workflows/pr-review-fix-scheduler.yml:97 - Immutable scheduler-source binding depends on unverified job.workflow_sha/job.workflow_repository context properties with a silent fail-open fallback
- Problem: The checkout step selects the privileged scheduler code exclusively via repository: ${{ job.workflow_repository }} (line 96) and ref: ${{ job.workflow_sha }} (line 97). The trusted bounded evidence contains no official GitHub Actions contexts documentation citation and no OPENCODE_EXECUTION_RECEIPT establishing these properties or their runtime expansion; the documented reusable-workflow SHA properties live in the github context (github.workflow_sha / github.job_workflow_sha) with the called workflow's repository derivable from github.workflow_ref. If the properties expand to empty strings, actions/checkout silently resolves the caller's repository at the caller's ref, so the elevated-token dispatch path (PR_REVIEW_MERGE_TOKEN || OPENCODE_APPROVE_TOKEN) runs whatever scheduler code the caller checkout provides and the claimed immutable binding is void.
- Root cause: The workflow comment asserts the 'job workflow context' exposes the called workflow's repository and immutable resolved SHA, but that runtime-support claim is not established by any trusted evidence in this run, and the only downstream check (python3 scripts/ci/pr_review_fix_scheduler.py --self-test) passes whenever the checked-out tree contains that script, so an empty or wrong source resolution is not detected and degrades fail-open instead of fail-closed.
- Fix: Bind the ref to the documented github.workflow_sha (or github.job_workflow_sha) and derive the repository from github.workflow_ref; add a guard step that fails the job when the resolved repository or SHA is empty so an unset property cannot silently fall back to the caller; cite the official GitHub contexts documentation in docs/doctoring/central-security-and-review-baseline.md; verify with a real repository_dispatch run and capture the resolved checkout ref in the run log.
- Regression test: Extend tests/test_pr_review_fix_scheduler_source_pin.py to assert the documented context expressions (github.workflow_sha / github.workflow_ref parsing) and an explicit empty-expansion guard step; run: python3 -m pytest tests
- Suggested diff: posted in this finding's inline review thread.
Summary
Review of PR #731 (13 changed files: .github/workflows/codeql-pr.yml, .github/workflows/pr-review-fix-scheduler.yml, .github/workflows/sbom-generation.yml, .github/workflows/scheduled-security-scan.yml, docs/automation/hourly-review-repair.md, docs/doctoring/central-security-and-review-baseline.md, requirements-strix-ci-hashes.txt, requirements-strix-ci.txt, scripts/ci/install_base_python_locks.py, and 4 new test files) at head 60f6009. Approval sufficiency: insufficient; the scheduler immutable-source security claim is not affirmatively established. Verification posture: trusted current-head diffs and inlined hunks + Coverage execution evidence PASS; no OPENCODE_EXECUTION_RECEIPT exists for workflow runtime behavior. Linter/static: repo contracts list hadolint, npm audit, pip_audit, bandit, trivy; no failed-check log evidence present. TDD/regression: new contract tests added (test_pr_review_fix_scheduler_source_pin.py, test_pr_review_fix_hourly_contract.py, test_sbom_generation_push_contract.py, test_install_base_python_lock_missing_pin.py). Coverage: Coverage execution evidence PASS - supported repository test suites passed. Docstring coverage: same Coverage decision PASS - configured docstring gates passed or advisory. DAG: source-backed flowchart of scheduler checkout->self-test->dispatch and sbom push->SHA-bound concurrency (head flow). DDD/domain: no domain objects changed; CI control-plane workflows only. CDD/context: caller/callee reusable-workflow contract context preserved. Similar issues: file history shows this binding introduced by prior merged automation (#745); no unresolved peer threads at current head. Claim/concept check: the 'immutable resolved SHA' claim is not backed by official GitHub context documentation in trusted evidence. Standards search: no external standard material in changed files beyond GitHub Actions context semantics. Compatibility/convention: canonical_ref retained as deprecated ignored input default ''; actions/checkout bumped to pinned v7.0.1; CodeQL init/analyze uniformly pinned to v4.37.5 in codeql-pr.yml and scheduled-security-scan.yml; identifiers remain idiomatic multi-word. Breaking-change/backcompat: canonical_ref behavior change is intentional and documented in the input description. Implementation completeness: installer classifier (_is_deferable_preflight_failure/_contains_unclassified_error/_matching_binary_unavailability_requirements/_is_concrete_version_list) is concrete and fail-closed with paired exact-requirement plus concrete PEP 440 version evidence; no placeholder bodies. Performance: hourly cron with retry_hours 1 is bounded by MAX_DISPATCHES=1; SBOM concurrency bound to github.sha. Developer experience: scheduler self-test step retained; hourly-review-repair.md added. User experience: non-web surface - CI/review-gate behavior; cadence changes from every 2h to hourly with 1h retry. Visual/DOM: non-web; interaction surface is workflow/review-comment output. Accessibility/i18n: not applicable to CI workflows; docs in English. Supply-chain/license: Strix lock hash regeneration with aiohttp/cryptography remediation claimed; hash-vs-source consistency not independently readable this run. Packaging: pytest contract via 'python3 -m pytest tests'; no unpackaged source surfaces reported. Security/privacy: P1 blocker - elevated-token scheduler checkout must be proven bound to the called workflow SHA (documented github.workflow_sha / github.job_workflow_sha, repository from github.workflow_ref) or guarded to fail closed.
Adversarial validation
{"status":"failed","probes":[{"path":".github/workflows/pr-review-fix-scheduler.yml","line":97,"hypothesis":"The immutable-source binding fails: job.workflow_repository/job.workflow_sha are not established GitHub job-context properties, so actions/checkout silently falls back to the caller's repository/ref and the privileged scheduler code is not bound to the called workflow's immutable SHA.","attack_or_counterexample":"A caller repository invokes this reusable workflow with or without its own scripts/ci/pr_review_fix_scheduler.py; with empty repository/ref, checkout resolves the caller's repo at the caller's resolved ref instead of the called workflow's SHA, and the self-test passes whenever the checked-out tree happens to contain the script.","evidence":"Trusted current-head diff at .github/workflows/pr-review-fix-scheduler.yml:97 shows the sole source selector is 'ref: ${{ job.workflow_sha }}' (repository at line 96) and the only downstream check is 'python3 scripts/ci/pr_review_fix_scheduler.py --self-test', which cannot distinguish an org-repo checkout from the called-workflow SHA checkout; the trusted evidence packet contains no official GitHub contexts documentation citation and no OPENCODE_EXECUTION_RECEIPT proving runtime expansion of these properties, and tests/test_pr_review_fix_scheduler_source_pin.py only pins YAML text, so the fail-open fallback hypothesis could not be falsified. source-line-sha256=ca0dd4f50aeb6eeff442d99351a07457cfa2bc575dab845b4072f716f52c2388","outcome":"confirmed"},{"path":".github/workflows/sbom-generation.yml","line":45,"hypothesis":"The concurrency-group fallback change from github.ref to github.sha causes two adjacent default-branch pushes to cancel each other, leaving a base commit without a dependency snapshot.","attack_or_counterexample":"Two rapid pushes to main within one run window that would previously collapse to the same group via the github.ref fallback.","evidence":"Trusted current-head diff at .github/workflows/sbom-generation.yml:45 shows the fallback 'github.event.release.tag_name || github.sha', and tests/test_sbom_generation_push_contract.py::test_sbom_push_concurrency_is_bound_to_the_commit_sha asserts the group line contains 'github.event.release.tag_name || github.sha' and not 'github.ref'; the Coverage execution evidence records the supported repository test suites passed (python3 -m coverage run -m pytest tests, --fail-under=100), so distinct push SHAs map to distinct concurrency groups and the cancellation hypothesis is falsified. source-line-sha256=78732b9dfe98e936dfdcd60a246f4a8852d4b7f8d00eac8ab82e6f87ae5d374b","outcome":"falsified"}],"residual_risk":"Even with the SBOM push contract verified, the scheduler source-binding mechanism remains unverified against official GitHub context documentation and a live dispatch run; CodeQL upload-sarif step alignment and regenerated Strix hash correctness were not readable from trusted evidence in this run."}-
Result: REQUEST_CHANGES
-
Reason: Blocking P1: the privileged scheduler checkout binds its immutable-source guarantee to job.workflow_repository/job.workflow_sha context properties whose existence and runtime expansion are not established by any trusted evidence in this run, and the unset-property failure mode is a silent fail-open fallback to the caller's repository/ref instead of a fail-closed error.
-
Head SHA:
60f60095013341c7fec78f29a1e1eb83a7890141 -
Workflow run: 30929181423
-
Workflow attempt: 1
Changed-File Evidence Map
flowchart LR
PR["PR changed files"] --> Evidence["OpenCode bounded evidence"]
Evidence --> S1["Workflow (4 files)"]
S1 --> I1["GitHub Actions review job"]
I1 --> R1["Review risk: Workflow (4 files)"]
R1 --> V1["actionlint plus required checks"]
Evidence --> S2["Docs (2 files)"]
S2 --> I2["operator or user guidance"]
I2 --> R2["Review risk: Docs (2 files)"]
R2 --> V2["docs review"]
Evidence --> S3["Changed file (2 files)"]
S3 --> I3["repository behavior"]
I3 --> R3["Review risk: Changed file (2 files)"]
R3 --> V3["required checks"]
Evidence --> S4["CI script: install_base_python_locks.py"]
S4 --> I4["review and security gate shell path"]
I4 --> R4["Review risk: CI script: install_base_python_locks.py"]
R4 --> V4["bash -n plus Strix self-test"]
Evidence --> S5["Test (4 files)"]
S5 --> I5["regression suite"]
I5 --> R5["Review risk: Test (4 files)"]
R5 --> V5["targeted test run"]
|
@opencode-agent Please independently re-review exact current head |
|
@cwl-noema-review Please independently review exact current head |
Dismissed as stale after the reviewed head moved from 60f60095013341c7fec78f29a1e1eb83a7890141 to e672f23d539114068ff74a7f190789217d15ef93. The sole P1 finding was addressed with test-first pre-checkout validation of all documented job.workflow_* identity fields, validated-output checkout, post-checkout SHA/file verification, official GitHub contexts citation, and a resolved review thread. A new independent exact-head review has been requested and remains required before merge.
|
@coderabbitai review Please perform one full substantive review of exact current head |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
repo='ContextualWisdomLab/.github'
pr='731'
head='e672f23d539114068ff74a7f190789217d15ef93'
echo '== Exact pull request identity =='
printf 'checked_out_head='; git rev-parse HEAD
git cat-file -t "$head"
git show -s --format='commit=%H%nparents=%P%nsubject=%s' "$head"
gh pr view "$pr" --repo "$repo" \
--json state,headRefOid,baseRefOid,mergeable,reviewDecision,url \
--jq '{state,headRefOid,baseRefOid,mergeable,reviewDecision,url}'
base="$(git merge-base "$head" origin/main)"
printf 'merge_base=%s\n' "$base"
echo '== Changed paths, scope, and whitespace =='
git diff --name-status "$base" "$head"
git diff --check "$base" "$head"
git diff --stat "$base" "$head"
echo '== Full diff of declared central-baseline files =='
git diff --unified=30 "$base" "$head" -- \
.github/workflows/codeql-pr.yml \
.github/workflows/pr-review-fix-scheduler.yml \
.github/workflows/sbom-generation.yml \
.github/workflows/scheduled-security-scan.yml \
docs/automation/hourly-review-repair.md \
docs/doctoring/central-security-and-review-baseline.md \
requirements-strix-ci.txt \
requirements-strix-ci-hashes.txt \
scripts/ci/install_base_python_locks.py \
tests/test_install_base_python_lock_missing_pin.py \
tests/test_pr_review_fix_hourly_contract.py \
tests/test_pr_review_fix_scheduler_source_pin.py \
tests/test_sbom_generation_push_contract.py
echo '== Changed implementation and test structure =='
for path in \
scripts/ci/install_base_python_locks.py \
tests/test_install_base_python_lock_missing_pin.py \
tests/test_pr_review_fix_hourly_contract.py \
tests/test_pr_review_fix_scheduler_source_pin.py \
tests/test_sbom_generation_push_contract.py
do
echo "--- $path"
ast-grep outline "$path" --items all
cat -n "$path"
done
echo '== Changed workflows =='
for path in \
.github/workflows/codeql-pr.yml \
.github/workflows/pr-review-fix-scheduler.yml \
.github/workflows/sbom-generation.yml \
.github/workflows/scheduled-security-scan.yml
do
echo "--- $path"
cat -n "$path"
done
echo '== Security-sensitive workflow indicators =='
rg -n -C3 \
'uses:\s*github/codeql-action/(init|analyze|upload-sarif)@|permissions:|contents:\s*write|pull-requests:\s*write|dependency-snapshot|job\.workflow_(repository|sha)|canonical_ref|cron:|github\.sha|git\s+push\b|gh\s+pr\s+merge\b|workflow_dispatch|pull_request_target|repository:|ref:|path:' \
.github/workflows/codeql-pr.yml \
.github/workflows/pr-review-fix-scheduler.yml \
.github/workflows/sbom-generation.yml \
.github/workflows/scheduled-security-scan.yml || true
echo '== Strix lock entries =='
rg -n -A30 -B4 '^(aiohttp|cryptography|pyopenssl)([<=>!~ ]|$)' \
requirements-strix-ci.txt requirements-strix-ci-hashes.txt
rg -n '^(aiohttp==3\.14\.1|cryptography==49\.0\.0)\b' \
requirements-strix-ci.txt requirements-strix-ci-hashes.txt || true
echo '== Changed documentation =='
cat -n docs/automation/hourly-review-repair.md
cat -n docs/doctoring/central-security-and-review-baseline.md
echo '== Exact-head check runs =='
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
--jq '.check_runs[] | [.name,.status,(.conclusion // "null"),.details_url] | `@tsv`' \
| sort -u
echo '== Exact-head incomplete or unsuccessful check runs =='
gh api --paginate "repos/$repo/commits/$head/check-runs?per_page=100" \
--jq '.check_runs[]
| select(.status != "completed" or (.conclusion != "success" and .conclusion != "neutral" and .conclusion != "skipped"))
| [.name,.status,(.conclusion // "null"),.details_url] | `@tsv`' \
| sort -u
echo '== Exact-head legacy statuses =='
gh api "repos/$repo/commits/$head/status" \
--jq '.statuses[] | [.context,.state,.target_url] | `@tsv`' | sort -u
echo '== Unresolved review threads =='
gh api graphql -F owner='ContextualWisdomLab' -F name='.github' -F number="$pr" -f query='
query($owner: String!, $name: String!, $number: Int!) {
repository(owner: $owner, name: $name) {
pullRequest(number: $number) {
reviewThreads(first: 100) { nodes { isResolved } }
}
}
}' --jq '[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] | length'Length of output: 245031
I found no actionable finding. The review verified these items:
The current-head evidence supports merge subject to repository branch protection. You are interacting with an AI system. |
Pull request was converted to draft
* test(ci): require hourly NVIDIA NIM review autofix * test(ci): cover both NVIDIA NIM autofix executions * chore(ci): add deterministic NVIDIA NIM autofix patcher * ci: validate and apply NVIDIA NIM autofix migration * docs(doctoring): define NVIDIA NIM autofix boundary * ci: verify and apply NVIDIA NIM autofix migration * ci: retrigger validated NVIDIA NIM migration * fix(ci): keep secret expressions literal in one-shot patch * fix(ci): route scheduled autofix through NVIDIA NIM * chore(ci): remove failed one-shot migration helper * chore(ci): remove superseded PR 752 patch script * chore(ci): remove superseded PR 752 patch workflow * test(ci): require fail-closed NVIDIA NIM secret handling * test(ci): harden NVIDIA NIM autofix trust boundary * chore(ci): apply reviewed NVIDIA autofix hardening * chore(ci): remove unused NVIDIA autofix patch workflow * fix(ci): harden NVIDIA NIM autofix trust boundary * docs(ci): record NVIDIA autofix trust-boundary hardening * test(ci): isolate GitHub credentials from OpenCode subprocesses * ci: apply reviewed NVIDIA NIM credential isolation * ci: repair deterministic credential-isolation patch * test(ci): pin independent reviewer workflow unchanged * ci: rerun credential isolation after reviewer pin fix * ci: publish credential isolation with workflow-capable token * ci: publish credential isolation with OpenCode App token * fix(ci): isolate OpenCode from GitHub credentials * ci: remove credential-isolation patch workflow * docs(doctoring): record OpenCode credential isolation boundary * ci: dispatch exact-head review for central baseline * ci: remove exact-head review dispatcher --------- Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com>
|
Closing as superseded by #757. The central review/security baseline from this branch was integrated into #757 together with the trusted agent-mention control plane, and subsequent exact-head fixes continue in #759. Keeping this historical branch open would duplicate checks and approvals against an older head. |
Problem
Five central defects form a control-plane deadlock or operating gap for dependency and security pull requests across the organization:
init/analyzeandupload-sarifused different CodeQL Action revisions.aiohttp==3.14.1andcryptography==49.0.0.maininstead of the reusable workflow's immutable source identity.These changes are one atomic central baseline because every affected required gate and scheduler evaluates the same central repository state. The former stacked pull requests #736 and #745 were merged directly into this branch.
Changes
CodeQL consistency
github/codeql-action/init,analyze, andupload-sarifreference in the affected workflows to the same immutable v4.37.5 commit.A follow-up Dependabot update may advance the single shared immutable revision after this baseline lands; this pull request's invariant is that every affected CodeQL phase uses exactly one revision.
Strix dependency remediation
aiohttp==3.14.1withaiohttp==3.14.3.cryptography==49.0.0withcryptography==50.0.0.aiohttp>=3.14.3and regenerate the complete hash lock with the compatible pyOpenSSL release.Bounded stale-pin recovery
none, blank lists, arbitrary prose such asunavailable, mixed version/prose lists, single-sided or mismatched resolver diagnostics, empty output, unknown failures, hash mismatches, retries, connection failures, andCould not fetch URLfatal.ERROR:line precedence even when the same output also contains otherwise deferable evidence.Default-branch dependency snapshots
main,master, anddevelopas well as pull requests and releases.github.sha, not a branch ref, so adjacent default-branch commits cannot cancel each other's snapshots.contents: writeonly where dependency submission requires it.Secure hourly review repair
PR Review Fix Schedulerat minute 23 of every hour.job.workflow_repositoryat immutablejob.workflow_sha.canonical_refonly as an ignored deprecated compatibility input.TDD and verification contracts
The regression suite proves:
none, blank, arbitrary prose, mixed version/prose, single-sided, mismatched, integrity, transport, mixed-unknown, and otherwise unclassified failure handling;Exact-current-head CodeQL, Python Security, Security Scan, Semgrep, OSV, Scorecard, Secret Scan, SBOM, OpenCode review, Noema review, unresolved-thread checks, and branch protection remain mandatory before merge.
Standards traceability
docs/automation/hourly-review-repair.mdis the operator contract.docs/doctoring/central-security-and-review-baseline.mdrecords the design rationale, verification contract, MSA boundary, and APA 7th references to GitHub primary documentation, the final NIST SSDF 1.1 publication, the SSDF 1.2 initial public draft, and approved SLSA 1.2 specification.n.d.with a retrieval date under APA 7th edition.Scope
Exactly thirteen files change:
.github/workflows/codeql-pr.yml.github/workflows/pr-review-fix-scheduler.yml.github/workflows/sbom-generation.yml.github/workflows/scheduled-security-scan.ymldocs/automation/hourly-review-repair.mddocs/doctoring/central-security-and-review-baseline.mdrequirements-strix-ci.txtrequirements-strix-ci-hashes.txtscripts/ci/install_base_python_locks.pytests/test_install_base_python_lock_missing_pin.pytests/test_pr_review_fix_hourly_contract.pytests/test_pr_review_fix_scheduler_source_pin.pytests/test_sbom_generation_push_contract.pyNo application code, repository-target authorization policy, review token permission, model budget, merge criterion, or vulnerability threshold is weakened. No branch-pushing or self-modifying one-shot workflow remains in the final tree.
Supersession
This atomic repair supersedes the relevant portions of closed #674, #704, #723, #727, #728, #729, #735 and the stacked/merged #736 and #745. Their unrelated changes remain excluded.